from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('https://www.baidu.com/')
driver.maximize_window()

span = driver.find_element(By.XPATH, "//li[@data-index='2']/a/span[@class='title-content-title']")
print(span.get_attribute('outerHTML'))


driver.quit()